<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.wxtf.platform.plugins.user.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
UserBean user = (UserBean)request.getSession().getAttribute("userBean");

String _db = user.getDbType();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/Aqua/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/<%=user.getUserCss()%>/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/ligerui-icons.css" />
		<link type="text/css" rel="stylesheet" href="resource/css/style.css" />
		<style type="text/css">
		body{
			overflow: scroll;
		}
		#baobiao{
			background-color:#EAEEF5;
		}
		#baobiao_table{
			border:1px #222222 solid;
			border-collapse:collapse;
		}
		#baobiao_table td{
			margin:0px;
			padding:0px;
			border:1px #222222 solid;
			font-size:14px;
			text-align:center;
		}
		#baobiao_table thead td{
			color:#3893CC;
			font-weight: bold;
			border:1px #222222 solid;
		}
		#baobiao_table tbody td{
			height:27px;
		}
		#baobiao_table tfoot td{
			text-align:left;
			padding-left:5px;
		}
		#col_num_tr td{
			height:40px;
		}
		#baobiao_table #date_td{
			text-align:right;
		}

		#baobiao_table #title_td{
			font-size:18px;
			font-weight:700;
		}
		#baobiao_table .comname_td{
			text-align:left;
			!font-size:12px;
		}
		#baobiao_table .children_td{
			text-align:right;
			font-size:13px;
			padding-right:2px;
		}
		#baobiao_table #year,#month,#day{
			width:35px;
			text-align:center;
		}
		.table_input{
			padding:0px;
			margin:0px;
			width:92%;
			font-size:13px;
			background:none;
			border:1px #EAEEF5 solid;
			text-align:center;
		}
		
		.otr_input{
			font-size:13px;
			font-weight:100;
			background:#EAEEF5;
		}
		
		.detail_link{
			text-decoration:none;
			color:#000000;
		}
		
		.detail_link:hover{
			text-decoration:none;
			color:#4fa8e6;
		}
	    </style>
	    
		<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="ligerUI/js/core/base.js"></script>
		<script type="text/javascript" src="ligerUI/js/ligerui.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
var _db = '<%=_db%>';
_jsonObj.classname = "com.wxtf.platform.main.sygl.sygl_tognjiAction";
_jsonObj.methodname = "search";
_jsonObj.logicdata = "[]";

var _dataTotal = 0;
$(function(){
	var d = new Date()
	$("#year").val(d.getFullYear());
	$("#month").val(d.getMonth()+1);
	$("#day").val(d.getDate());
	
});

function serch1(btn){
	btn.disabled = true;
	var orgIds = $('#org2').val();
	_jsonObj.logicdata = '[{\"orgIds\":\"' + orgIds	+ '\"}]';
	callserver(_jsonObj, function(data, textStatus){
		if(data.length > 0){
			var html = '';
			for(var i = 0 ; i < data.length; i++){
				var info = data[i].info.split('_');
				html += '<tr id="trs'+(i + 1)+'"><input type="hidden" id="tr'+(i + 1)+'" value="0"><td>' + (i + 1) + '</td>';
				if(parseInt(data[i].child) > 0){
					html += '<td class="comname_td" style="text-align: left;"><a href="#" onclick="showView(\''+(i + 1)+'\',\''+data[i].child2+'\');return false;" style="text-decoration:none;color:blue;">'+ data[i].caption +'</a></td>';
				} else {
					html += '<td class="comname_td" style="text-align: left;">'+ data[i].caption +'</td>';
				}
				
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=3&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[0] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=4&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[1] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=5&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[2] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=6&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[3] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=7&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[4] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=8&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[5] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=9&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[6] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=10&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[7] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=11&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[8] +'</a></td>';
				
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=12&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[9] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=13&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[10] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=14&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ (parseInt(info[9])-parseInt(info[10])) +'</a></td>';
				html += '<td>'+ (parseInt(info[9])-parseInt(info[12])) +'</td>';
				
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=16&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[13] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=17&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[14] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=18&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[15] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=19&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[16] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=20&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[17] +'</a></td>';
				html += '<td><a target="_blank" href="jsp/sygl/tongji_employee.jsp?type=21&child='+data[i].child+'&orgid=' + data[i].id + '" class="detail_link">'+ info[18] +'</a></td>';
				html += '</tr>';
			}
			
			$("#baobiao_table tbody").html(html);
		}
		btn.disabled = false;
	}, function (data, textStatus){
		warningTip(data.resultrecord);
		btn.disabled = false;
	});
}

/*
 * 收缩展开
 */
function showView(trId, child){
	var isShow = document.getElementById('tr'+trId).value;
	var display = 'none';
	if(isShow == '0'){
		document.getElementById('tr'+trId).value = '1';
		display = 'none';
	} else if(isShow == '1'){
		document.getElementById('tr'+trId).value = '0';
		display = "";
	}
	for(var i = 1; i <= child; i++){
		var id = 'trs' + (parseInt(trId) + i);
		document.getElementById(id).style.display = display;
	}
	
}


function expData(btn){
	var _jsonObj1 = {};

	_jsonObj1.classname = "com.wxtf.platform.main.sygl.sygl_tognjiAction";
	_jsonObj1.methodname = "expData";
	_jsonObj1.logicdata = "[]";
	btn.disabled = true;
	var orgIds = $('#org2').val();
	_jsonObj1.logicdata = '[{\"orgIds\":\"' + orgIds	+ '\"}]';
	callserver(_jsonObj1, function(data, textStatus){
		if(data.result){
			downloadFile(data.resultrecord);
		} else {
			warningTip(data.resultrecord);
		}
		btn.disabled = false;
	});
}


</script>
		
</head>
  
  	<body>
	  <table id="aaa" class="serTable">
			<tr>
				<td>
					机构：<select id="org2" style=" width: 160px;">
						<%=user.getCurSubOrgOptions()%>
					</select>
				</td>
				<td><input class="btn2" value="搜索" type="button" onclick="serch1(this);"/></td>
				<td><input class="btn2" value="导出" type="button" onclick="expData(this);" /></td>
			</tr>
		</table>
	    <div id="baobiao" style="margin-left:20px;">
	    	<table id="baobiao_table">
				<thead>
					<tr><td id="title_td" colspan="21" height="40">第一汽车集团公司生育情况实时统计表</td></tr>
					<tr><td id="date_td" colspan="21" height="30"><input type="text" id="year" name="year" readonly="readonly" class="otr_input textbg1"/>年<input type="text" id="month" name="month" readonly="readonly" class="otr_input textbg1"/>月<input type="text" id="day" name="day" readonly="readonly" size="2" class="otr_input textbg1"/>日</td></tr>
					<tr>
						<td rowspan="3" width="25">序<br/><br/>号</td>
						<td rowspan="3" width="110" align="left">单&nbsp;&nbsp;位</td>
						<td colspan="3">已婚育龄职工数</td>
						<td colspan="3">已婚育龄无<br/>生育条件人数</td>
						<td colspan="3">已婚育龄有<br/>生育条件人数</td>
						<td colspan="4">独生子女情况</td>
						<td colspan="6">生育情况</td>
					</tr>
					<tr>
						<td rowspan="2" width="50">合<br/><br/>计</td>
						<td rowspan="2" width="50">男</td>
						<td rowspan="2" width="50">女</td>
						<td rowspan="2" width="50">合<br/><br/>计</td>
						<td rowspan="2" width="50">男</td>
						<td rowspan="2" width="50">女</td>
						<td rowspan="2" width="50">合<br/><br/>计</td>
						<td rowspan="2" width="50">男</td>
						<td rowspan="2" width="50">女</td>
						<td rowspan="2" width="50">应<br/>办<br/>证</td>
						<td rowspan="2" width="50">已<br/>办<br/>证</td>
						<td rowspan="2" width="50">未<br/>办<br/>证</td>
						<td rowspan="2" width="50">子<br/>女<br/>数</td>
						<td rowspan="2" width="50">怀<br/>孕</td>
						<td rowspan="2" width="50">等<br/>孕</td>
						<td rowspan="2" width="50">新<br/>生<br/>儿</td>
						<td rowspan="2" width="50">计<br/>划<br/>内<br/>一<br/>胎</td>
						<td rowspan="2" width="50">计<br/>划<br/>内<br/>二<br/>胎</td>
						<td rowspan="2" width="50">晚婚<br/>+<br/>晚育</td>
					</tr>
					<tr>
					</tr>
					
					<tr id="col_num_tr"><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td></tr>
				</thead>
				<tbody>
					<tr><td colspan="21"></td></tr>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="21" height="40">
							逻辑关系:
							&nbsp;&nbsp;&nbsp;&nbsp;3=4+5;
							&nbsp;&nbsp;&nbsp;&nbsp;6=7+8;
							&nbsp;&nbsp;&nbsp;&nbsp;9=10+11;
							&nbsp;&nbsp;&nbsp;&nbsp;18=19+20;
						</td>
					</tr>
				</tfoot>
			</table>
			<br/>
	    </div>
	</body>
</html>


